package com.obelisco.vista.seguridad;

import nextapp.echo2.app.Column;
import nextapp.echo2.app.ImageReference;
import nextapp.echo2.app.Label;

import com.obelisco.modelo.data.CarpetaTransaccion;
import com.obelisco.vista.estilos.Styles;
import com.obelisco.vista.imagen.ByteArrayImageReference;
import com.obelisco.vista.inicio.Aplicacion;

import echopointng.tree.DefaultMutableTreeNode;
import echopointng.tree.DefaultTreeIcons;

public class TreeNodeCarpeta extends TreeNodeCustom {

	private CarpetaTransaccion carpeta;


	public TreeNodeCarpeta(CarpetaTransaccion carpeta) {
		super();
		this.carpeta = carpeta;
		
		setEtiqueta(carpeta.getNombre());

		ImageReference icono = Styles.ICON_16_FOLDER;
		if (carpeta.getIcono() != null && carpeta.getIcono().getContenido().length > 0) {
			icono = new ByteArrayImageReference(carpeta.getIcono().getContenido());
		}

		setIcono(icono);

		this.setAllowsChildren(true);
		
	}


	public CarpetaTransaccion getCarpeta() {
		return carpeta;
	}


	public void setCarpeta(CarpetaTransaccion carpeta) {
		this.carpeta = carpeta;
	}
}
